/**
 * \file XMLElement.h
 * \brief XMLElement declaration class
 * \author Edouard ROGE
 * \date 16 October 2012
 */

#ifndef _XML_ELEMENT_
#define _XML_ELEMENT_

#include "XMLNode.h"
#include "XMLAttribute.h"

namespace Core
{
	namespace File
	{
		/**
		 * \class XMLElement
		 * \brief Xml element. Contains an string which helps to define the element and some attributes
		 */
		class XMLElement : public XMLNode
		{
		public:

			/**
			 * \fn XMLElement();
			 * \brief Default constructor
			 */
			XMLElement();

			/**
			 * \fn ~XMLElement();
			 * \brief Destructor
			 */
			~XMLElement();

			/**
			 * \fn void SetAttributes(const Array<XMLAttribute*> & _attributes);
			 * \param _attributes new attributes
			 * \brief Set new attributes for this xml element
			 */
			void SetAttributes(const std::vector<XMLAttribute*> & _attributes);

			/**
			 * \fn const Array<XMLAttribute*> &  GetAttributes() const;
			 * \return xml attributes
			 * \brief retrieve attribute array
			 */
			const std::vector<XMLAttribute*> &  GetAttributes() const;

			/**
			 * \fn virtual error Save(File & _file) const;
			 * \param _file file to write in
			 * \return if success, returns errOK
			 * \brief Save in xml file
			 */
			virtual error Save(File & _file, uint32 _iDepth) const;

		private:

			/** element's attributes */
			std::vector<XMLAttribute*> m_Attributes;
		};
	}
}

#endif // _XML_ELEMENT_
